#ifndef _ENTITY_H_
#define _ENTITY_H_

#define _USE_MATH_DEFINES

#include "Constants.h"
#include "feature\Feature.h"
#include "Polygon.h"
#include <string>
#include <list>
#include <vector>

using namespace std;

namespace model
{
class Entity
{
public:
	Entity(void);
	virtual ~Entity(void);
	virtual string getImagePath(void)=0;
	virtual void setImagePath(string)=0;
	virtual void updatePositions(double currentTime)=0;
	int getId(void);
	void setId(int id) { this->id = id;}

	Point getPosition(void);
	Polygon* getPolygon(void);
	void setPolygon(Polygon*);

	virtual void setX(double);
	virtual double getX(void);
	virtual void setY(double);
	virtual double getY(void);
    virtual void setPosition(double x, double y);
	virtual void setRotation(double);
	virtual double getRotation(void);
	virtual void setDirectionOfVelocity(double);
	virtual double getDirectionOfVelocity(void);
	virtual void setVelocity(double);
	virtual double getVelocity(void);	
	virtual void enableInvisibility(void);
	virtual bool isInvisibilityEnabled(void);
	virtual void disableInvisibility(void);
	virtual void enableIsDead(void);
	virtual bool isDeadEnabled(void);
	virtual void disableIsDead(void);
	virtual double getDeadStartTime(void);
	virtual	bool isOwnEntity(void);
	virtual void setIsOwnEntity(bool ownShip);

	void addFeature(Feature*);
	vector<Feature*> getFeatures(void);

protected:
	
	virtual void move(void);
	virtual void updateFeaturePosition();

	auto_ptr<Polygon> polygon;
	vector<Feature*> features;
	int id;
	double x;
	double y;
	double velocity;
	double rotation, previousRotation;
	double directionOfVelocity;
	double currentTime;
	double directionModul;
	bool isInvisible;
	bool isDead;
	double invisibilityStartTime;
	double deadStartTime;
	bool isOwn;
};
};

#endif
